package com.wsjc.manager.dao.area.impl;

import java.util.Map;

import org.springframework.stereotype.Repository;

import com.beust.jcommander.internal.Maps;
import com.wsjc.common.core.dao.impl.BaseDaoImpl;
import com.wsjc.manager.dao.area.WjAreaDao;
import com.wsjc.manager.entity.WjArea;

@Repository
public class WjAreaDaoImpl extends BaseDaoImpl<WjArea> implements WjAreaDao{

	@Override
	public void updateBaiDuName(String provinceName, String areaName) {
		
		Map<String, String> params = Maps.newHashMap();
		params.put("baiduName", areaName);
		
		// 条件
		provinceName = provinceName.substring(0, provinceName.length());
		params.put("provinceName", provinceName);
		areaName = areaName.substring(0, areaName.length()-1);
		params.put("areaName", areaName);
		this.getSessionTemplate().update(getStatement("updateName"),params);
	}
	
	@Override
	public void updateGaoDeName(String provinceName, String areaName) {
		
		Map<String, String> params = Maps.newHashMap();
		params.put("gaodeName", areaName);
		
		// 条件
		provinceName = provinceName.substring(0, provinceName.length());
		params.put("provinceName", provinceName);
		areaName = areaName.substring(0, areaName.length()-1);
		params.put("areaName", areaName);
		this.getSessionTemplate().update(getStatement("updateName"),params);
	}

	
	
}
